Learn R Programming

socialmixr (version 0.7.0)

[.contact_survey: Subset a contact survey

Description

Filters a contact_survey object using an expression. The expression is evaluated against whichever table(s) contain the referenced columns (participants, contacts, or both). When participants are filtered, contacts are automatically pruned to matching part_ids.

Usage

# S3 method for contact_survey
[(x, i, ...)

Value

a filtered contact_survey object

Arguments

x

a contact_survey object

i

an expression to evaluate as a row filter (e.g. country == "United Kingdom")

...

ignored

Examples

Run this code
data(polymod)
polymod[country == "United Kingdom"]

Run the code above in your browser using DataLab